#!/bin/sh

for i in $PLIBDIRS # $PLIBDIRS is exported in 2createpackages
do
	[ -d $i ] || continue
	#hack for debian squeezy...
	LIBCDIOEXIST="`ls ${i}/libcdio.so.* 2>/dev/null | head -n 1`"
	if [ "$LIBCDIOEXIST" ] ; then
		BASEEXIST=${LIBCDIOEXIST##*/} #"`basename $LIBCDIOEXIST`"
		if [ ! -e ${i}/libcdio.so.7 ];then
			ln -sv $BASEEXIST ${i}/libcdio.so.7
		fi
		if [ ! -e ${i}/libcdio.so.12 ];then
			ln -sv $BASEEXIST ${i}/libcdio.so.12
		fi
	fi
	#120907
	LIB9660EXIST="`ls ${i}/libiso9660.so.* 2>/dev/null | head -n 1`"
	if [ "$LIB9660EXIST" ] ; then
		BASEEXIST=${LIB9660EXIST##*/} #"`basename $LIB9660EXIST`"
		if [ ! -e ${i}/libiso9660.so.7 ];then
			ln -sv $BASEEXIST ${i}/libiso9660.so.7
		fi
		if [ ! -e ${i}/libiso9660.so.5 ];then
			ln -sv $BASEEXIST ${i}/libiso9660.so.5
		fi
	fi
done
